package com.czk.ssalocalmcpserver.config;

import com.czk.ssalocalmcpserver.service.WeatherService;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: chenzhangkun
 * @CreateTime: 2025-11-03
 * @Description:
 * @Version: 1.0
 */
@Configuration
public class McpServerConfig {
    /**
     * 将工具暴露给mcp客户端使用
     *
     * @param weatherService
     * @return
     */
    @Bean
    public ToolCallbackProvider weatherTools(WeatherService weatherService) {
        return MethodToolCallbackProvider.builder()
                .toolObjects(weatherService)
                .build();
    }


}
